class MyDict(dict):
    def __setattr__(self,key,value):
        self[key]=value
    
    def __getattr__(self,item):
        return self.get(item)

obj=MyDict()
obj.name='jason'
obj.pwd=18
obj.hobby='read'
print(obj['name'])
print(obj.pwd)
print(obj.hobby)
print(type(obj))